package cn.richinfo.subscribehd.adapter;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Random;
import android.content.Context;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import cn.richinfo.framework.lang.DateAndValueOfUtils;

public class BaseAdapterDemo extends BaseAdapter {
	private Context context;
	private LayoutInflater inflater;
	private static List<String> billList;

	public BaseAdapterDemo(Context ctx, List<String> _list) {
		this.context = ctx;
		this.billList = _list;
		inflater = LayoutInflater.from(context);
	}

	public void resetBillList(List<String> list) {
		this.billList = list;
	}

	@Override
	public int getCount() {
		return billList.size();
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.xxxxxx, null);
			holder.month = (TextView) convertView
					.findViewById(R.id.xxxxxx);
			holder.pic = (ImageView) convertView
					.findViewById(R.xxxxxx);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
			holder.month.setText(billList.get(position););
			holder.pic.setImageResource(R.drawable.xxxxxx);

		return convertView;
	}

	private class ViewHolder {
		TextView month;
		ImageView pic;
	}

}
